3.1.68 \(\int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx\) [68]

3.1.68.1 Optimal result
3.1.68.2 Mathematica [A] (verified)
3.1.68.3 Rubi [A] (verified)
3.1.68.4 Maple [A] (verified)
3.1.68.5 Fricas [A] (verification not implemented)
3.1.68.6 Sympy [F]
3.1.68.7 Maxima [C] (verification not implemented)
3.1.68.8 Giac [F(-2)]
3.1.68.9 Mupad [F(-1)]

3.1.68.1 Optimal result

Integrand size = 26, antiderivative size = 87 \[ \int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f}-\frac {2 \sqrt {2} c \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} f} \]

output
2*c*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))/f/a^(1/2)-2*c*arctan 
(1/2*a^(1/2)*tan(f*x+e)*2^(1/2)/(a+a*sec(f*x+e))^(1/2))*2^(1/2)/f/a^(1/2)
 
3.1.68.2 Mathematica [A] (verified)

Time = 0.36 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.17 \[ \int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 c^{3/2} \left (\text {arctanh}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {c}}\right )-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {c-c \sec (e+f x)}}{\sqrt {2} \sqrt {c}}\right )\right ) \tan (e+f x)}{f \sqrt {a (1+\sec (e+f x))} \sqrt {c-c \sec (e+f x)}} \]

input
Integrate[(c - c*Sec[e + f*x])/Sqrt[a + a*Sec[e + f*x]],x]
 
output
(2*c^(3/2)*(ArcTanh[Sqrt[c - c*Sec[e + f*x]]/Sqrt[c]] - Sqrt[2]*ArcTanh[Sq 
rt[c - c*Sec[e + f*x]]/(Sqrt[2]*Sqrt[c])])*Tan[e + f*x])/(f*Sqrt[a*(1 + Se 
c[e + f*x])]*Sqrt[c - c*Sec[e + f*x]])
 
3.1.68.3 Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.98, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3042, 4392, 3042, 4375, 383, 216}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {c-c \sec (e+f x)}{\sqrt {a \sec (e+f x)+a}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {c-c \csc \left (e+f x+\frac {\pi }{2}\right )}{\sqrt {a \csc \left (e+f x+\frac {\pi }{2}\right )+a}}dx\)

\(\Big \downarrow \) 4392

\(\displaystyle -a c \int \frac {\tan ^2(e+f x)}{(\sec (e+f x) a+a)^{3/2}}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle -a c \int \frac {\cot \left (e+f x+\frac {\pi }{2}\right )^2}{\left (\csc \left (e+f x+\frac {\pi }{2}\right ) a+a\right )^{3/2}}dx\)

\(\Big \downarrow \) 4375

\(\displaystyle \frac {2 a c \int \frac {\tan ^2(e+f x)}{(\sec (e+f x) a+a) \left (\frac {a \tan ^2(e+f x)}{\sec (e+f x) a+a}+1\right ) \left (\frac {a \tan ^2(e+f x)}{\sec (e+f x) a+a}+2\right )}d\left (-\frac {\tan (e+f x)}{\sqrt {\sec (e+f x) a+a}}\right )}{f}\)

\(\Big \downarrow \) 383

\(\displaystyle \frac {2 a c \left (\frac {2 \int \frac {1}{\frac {a \tan ^2(e+f x)}{\sec (e+f x) a+a}+2}d\left (-\frac {\tan (e+f x)}{\sqrt {\sec (e+f x) a+a}}\right )}{a}-\frac {\int \frac {1}{\frac {a \tan ^2(e+f x)}{\sec (e+f x) a+a}+1}d\left (-\frac {\tan (e+f x)}{\sqrt {\sec (e+f x) a+a}}\right )}{a}\right )}{f}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {2 a c \left (\frac {\arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{a^{3/2}}-\frac {\sqrt {2} \arctan \left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a \sec (e+f x)+a}}\right )}{a^{3/2}}\right )}{f}\)

input
Int[(c - c*Sec[e + f*x])/Sqrt[a + a*Sec[e + f*x]],x]
 
output
(2*a*c*(ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]]/a^(3/2) - 
(Sqrt[2]*ArcTan[(Sqrt[a]*Tan[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sec[e + f*x]])] 
)/a^(3/2)))/f
 

3.1.68.3.1 Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 383
Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Sym 
bol] :> Simp[(-a)*(e^2/(b*c - a*d))   Int[(e*x)^(m - 2)/(a + b*x^2), x], x] 
 + Simp[c*(e^2/(b*c - a*d))   Int[(e*x)^(m - 2)/(c + d*x^2), x], x] /; Free 
Q[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LeQ[2, m, 3]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4375
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n 
_.), x_Symbol] :> Simp[-2*(a^(m/2 + n + 1/2)/d)   Subst[Int[x^m*((2 + a*x^2 
)^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c + d*x] 
]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && I 
ntegerQ[n - 1/2]
 

rule 4392
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*( 
d_.) + (c_))^(n_.), x_Symbol] :> Simp[((-a)*c)^m   Int[Cot[e + f*x]^(2*m)*( 
c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && E 
qQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !( 
IntegerQ[n] && GtQ[m - n, 0])
 
3.1.68.4 Maple [A] (verified)

Time = 2.42 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.57

method result size
default \(-\frac {2 c \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \left (\sqrt {2}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )-\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )\right )}{f a}\) \(137\)
parts \(-\frac {c \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \left (\sqrt {2}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )-2 \,\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )\right )}{f a}-\frac {c \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {2}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right ) \sqrt {a \left (\sec \left (f x +e \right )+1\right )}}{f a}\) \(232\)

input
int((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)
 
output
-2*c/f/a*(a*(sec(f*x+e)+1))^(1/2)*(-cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(2^(1 
/2)*ln(csc(f*x+e)-cot(f*x+e)+(cot(f*x+e)^2-2*csc(f*x+e)*cot(f*x+e)+csc(f*x 
+e)^2-1)^(1/2))-arctanh(sin(f*x+e)/(cos(f*x+e)+1)/(-cos(f*x+e)/(cos(f*x+e) 
+1))^(1/2)))
 
3.1.68.5 Fricas [A] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 298, normalized size of antiderivative = 3.43 \[ \int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx=\left [\frac {\sqrt {2} a c \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{a}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) - \sqrt {-a} c \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right )}{a f}, \frac {2 \, {\left (\sqrt {2} \sqrt {a} c \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) - \sqrt {a} c \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right )\right )}}{a f}\right ] \]

input
integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x, algorithm="fricas")
 
output
[(sqrt(2)*a*c*sqrt(-1/a)*log((2*sqrt(2)*sqrt((a*cos(f*x + e) + a)/cos(f*x 
+ e))*sqrt(-1/a)*cos(f*x + e)*sin(f*x + e) + 3*cos(f*x + e)^2 + 2*cos(f*x 
+ e) - 1)/(cos(f*x + e)^2 + 2*cos(f*x + e) + 1)) - sqrt(-a)*c*log((2*a*cos 
(f*x + e)^2 + 2*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + 
 e)*sin(f*x + e) + a*cos(f*x + e) - a)/(cos(f*x + e) + 1)))/(a*f), 2*(sqrt 
(2)*sqrt(a)*c*arctan(sqrt(2)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f 
*x + e)/(sqrt(a)*sin(f*x + e))) - sqrt(a)*c*arctan(sqrt((a*cos(f*x + e) + 
a)/cos(f*x + e))*cos(f*x + e)/(sqrt(a)*sin(f*x + e))))/(a*f)]
 
3.1.68.6 Sympy [F]

\[ \int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx=- c \left (\int \frac {\sec {\left (e + f x \right )}}{\sqrt {a \sec {\left (e + f x \right )} + a}}\, dx + \int \left (- \frac {1}{\sqrt {a \sec {\left (e + f x \right )} + a}}\right )\, dx\right ) \]

input
integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))**(1/2),x)
 
output
-c*(Integral(sec(e + f*x)/sqrt(a*sec(e + f*x) + a), x) + Integral(-1/sqrt( 
a*sec(e + f*x) + a), x))
 
3.1.68.7 Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.62 (sec) , antiderivative size = 699, normalized size of antiderivative = 8.03 \[ \int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx=-\frac {{\left (\sqrt {2} \sqrt {a} \arctan \left (\frac {{\left ({\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{4} + 16 \, \cos \left (f x + e\right )^{4} + 16 \, \sin \left (f x + e\right )^{4} + 8 \, {\left (\cos \left (f x + e\right )^{2} - \sin \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) + 1\right )} {\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2} - 64 \, \cos \left (f x + e\right )^{3} + 32 \, {\left (\cos \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right )^{2} + 96 \, \cos \left (f x + e\right )^{2} - 64 \, \cos \left (f x + e\right ) + 16\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\frac {8 \, {\left (\cos \left (f x + e\right ) - 1\right )} \sin \left (f x + e\right )}{{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2}}, \frac {{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2} + 4 \, \cos \left (f x + e\right )^{2} - 4 \, \sin \left (f x + e\right )^{2} - 8 \, \cos \left (f x + e\right ) + 4}{{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2}}\right )\right ) + 2 \, \sin \left (f x + e\right )}{{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}}, \frac {{\left ({\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{4} + 16 \, \cos \left (f x + e\right )^{4} + 16 \, \sin \left (f x + e\right )^{4} + 8 \, {\left (\cos \left (f x + e\right )^{2} - \sin \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) + 1\right )} {\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2} - 64 \, \cos \left (f x + e\right )^{3} + 32 \, {\left (\cos \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right )^{2} + 96 \, \cos \left (f x + e\right )^{2} - 64 \, \cos \left (f x + e\right ) + 16\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\frac {8 \, {\left (\cos \left (f x + e\right ) - 1\right )} \sin \left (f x + e\right )}{{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2}}, \frac {{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2} + 4 \, \cos \left (f x + e\right )^{2} - 4 \, \sin \left (f x + e\right )^{2} - 8 \, \cos \left (f x + e\right ) + 4}{{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}^{2}}\right )\right ) + 2 \, \cos \left (f x + e\right ) - 2}{{\left | 2 \, e^{\left (i \, f x + i \, e\right )} + 2 \right |}}\right ) - \sqrt {a} \arctan \left ({\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \sin \left (f x + e\right ), {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \cos \left (f x + e\right )\right )\right )} c}{a f} \]

input
integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x, algorithm="maxima")
 
output
-(sqrt(2)*sqrt(a)*arctan2(((abs(2*e^(I*f*x + I*e) + 2)^4 + 16*cos(f*x + e) 
^4 + 16*sin(f*x + e)^4 + 8*(cos(f*x + e)^2 - sin(f*x + e)^2 - 2*cos(f*x + 
e) + 1)*abs(2*e^(I*f*x + I*e) + 2)^2 - 64*cos(f*x + e)^3 + 32*(cos(f*x + e 
)^2 - 2*cos(f*x + e) + 1)*sin(f*x + e)^2 + 96*cos(f*x + e)^2 - 64*cos(f*x 
+ e) + 16)^(1/4)*sin(1/2*arctan2(8*(cos(f*x + e) - 1)*sin(f*x + e)/abs(2*e 
^(I*f*x + I*e) + 2)^2, (abs(2*e^(I*f*x + I*e) + 2)^2 + 4*cos(f*x + e)^2 - 
4*sin(f*x + e)^2 - 8*cos(f*x + e) + 4)/abs(2*e^(I*f*x + I*e) + 2)^2)) + 2* 
sin(f*x + e))/abs(2*e^(I*f*x + I*e) + 2), ((abs(2*e^(I*f*x + I*e) + 2)^4 + 
 16*cos(f*x + e)^4 + 16*sin(f*x + e)^4 + 8*(cos(f*x + e)^2 - sin(f*x + e)^ 
2 - 2*cos(f*x + e) + 1)*abs(2*e^(I*f*x + I*e) + 2)^2 - 64*cos(f*x + e)^3 + 
 32*(cos(f*x + e)^2 - 2*cos(f*x + e) + 1)*sin(f*x + e)^2 + 96*cos(f*x + e) 
^2 - 64*cos(f*x + e) + 16)^(1/4)*cos(1/2*arctan2(8*(cos(f*x + e) - 1)*sin( 
f*x + e)/abs(2*e^(I*f*x + I*e) + 2)^2, (abs(2*e^(I*f*x + I*e) + 2)^2 + 4*c 
os(f*x + e)^2 - 4*sin(f*x + e)^2 - 8*cos(f*x + e) + 4)/abs(2*e^(I*f*x + I* 
e) + 2)^2)) + 2*cos(f*x + e) - 2)/abs(2*e^(I*f*x + I*e) + 2)) - sqrt(a)*ar 
ctan2((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^( 
1/4)*sin(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + sin(f*x + 
e), (cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/ 
4)*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + cos(f*x + e) 
))*c/(a*f)
 
3.1.68.8 Giac [F(-2)]

Exception generated. \[ \int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx=\text {Exception raised: TypeError} \]

input
integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^(1/2),x, algorithm="giac")
 
output
Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:index.cc index_m i_lex_is_greater E 
rror: Bad Argument Value
 
3.1.68.9 Mupad [F(-1)]

Timed out. \[ \int \frac {c-c \sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx=\int \frac {c-\frac {c}{\cos \left (e+f\,x\right )}}{\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}} \,d x \]

input
int((c - c/cos(e + f*x))/(a + a/cos(e + f*x))^(1/2),x)
 
output
int((c - c/cos(e + f*x))/(a + a/cos(e + f*x))^(1/2), x)